package com.yami.shop.rights.common.listener;

import com.yami.shop.bean.event.UpdateRightsEvent;
import com.yami.shop.rights.common.strategy.PersonRightsFactory;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

@Slf4j
@Component("UpdateRightsListener")
@AllArgsConstructor
public class UpdateRightsListener {

    @Autowired
    private PersonRightsFactory personRightsFactory;

    /**
     * 功能描述: 持仓转移权益修改
     * @Author: LSR
     * @Date: 2023/6/19 11:47
     */
    @EventListener(UpdateRightsEvent.class)
    public void updatePersonRights(UpdateRightsEvent event) {

        personRightsFactory.updatePersonRights(event);

    }

}
